﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ArticleEdit.aspx.cs" Inherits="School.SystemManage.WebPages.ArticlePage.ArticleEdit" %>
<%@ Register TagPrefix="uc" TagName="TXTEditor" Src="~/Controls/TXTEditor.ascx"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="../../css/right.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #rbtnIsMainNews td,#rbtIsEnabled td{ border:none;}
        .title_box input[type=text]{ width:99%;  border:none;}
        .innerTable td{ border:none; vertical-align:top; text-align:left;}
        .innerTable textarea{ height:100%;}
        .innerTable ul{border:solid 1px #A8C7CE; }
        .innerTable ul li{ list-style:none; width:200px;}
        .caption{ border-bottom:solid 1px #A8C7CE; background-color:#D3EAEF; text-align:center;}
        .priviewFileName{ margin-left:3px;}
        .priviewFileText{ margin-right:3px;height: 12px;}
        #article_container .td1{ width:10%;}
        #article_container .td2{ width:90%;}
    </style>
    <script src="../../../JS/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="../../../JS/jquery.MultiFile.js" type="text/javascript"></script>
    <script type="text/javascript">
        function HasCheckedRow() {
            var item = document.getElementById("attachmentItem");
            var checkBoxes = item.getElementsByTagName("INPUT");
            for (var i = 0; i < checkBoxes.length; i++) {
                if (checkBoxes[i].checked)
                    return confirm("确定要删除吗？");
            }
            alert("选择要删除的项");
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="title_bg">
            <div class="floatLeft title_text_div"><%=menu %> > <%=subMenu %></div> 
            <div class="clear"></div>
        </div>
        <div>
            <div id="article_container">
                <table class="dataTable">
                    <tr><td colspan="2" class="content_title"><%=actionName %></td></tr>
                    <tr>
                        <td class="td1">类别：</td>
                        <td class="td2"><%=subMenu%></td>
                    </tr>
                    <tr>
                        <td class="td1">标题：</td>
                        <td class="td2 title_box"><asp:TextBox ID="txbTitle" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td class="td1">内容：</td>
                        <td class="td2"><uc:TXTEditor ID="editor" runat="server"/></td>
                    </tr>
                    <tr>
                        <td class="td1">首页新闻：</td>
                        <td class="td2">
                            <asp:RadioButtonList ID="rbtnIsMainNews" runat="server" RepeatDirection="Horizontal" Enabled="false">
                                <asp:ListItem Value="1">是</asp:ListItem>
                                <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td class="td1">首页图片：</td>
                        <td class="td2 blue">
                            <asp:FileUpload ID="FileUpload1" runat="server" Enabled="false" />
                            <asp:Literal ID="ltrMainImg" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <td class="td1">是否启用：</td>
                        <td class="td2">
                            <asp:RadioButtonList ID="rbtIsEnabled" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="1" Selected="True">是</asp:ListItem> 
                                <asp:ListItem Value="0" >否</asp:ListItem>                                                             
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td class="td1">附件：</td>
                        <td class="td2 blue">
                            <table class="innerTable">
                                <tr>
                                    <td><asp:FileUpload ID="FileUpload2" runat="server" class="multi" /></td>
                                    <td><asp:TextBox ID="txbFileNames" runat="server" TextMode="MultiLine"></asp:TextBox><br />
                                        <span class="red">(填写各附件在页面上显示时的标题，各标<br />题用逗号分隔，并确保附件数与标题数一致)</span></td>
                                    <td>
                                        <ul id="attachmentItem">
                                            <li class="caption">
                                                <div class="floatLeft">已上传附件</div>
                                                <div class="floatRight priviewFileText">
                                                    <asp:LinkButton ID="lbtnDel" runat="server" onclick="lbtnDel_Click" OnClientClick="return HasCheckedRow();">删除</asp:LinkButton>
                                                </div>
                                                <div class="clear"></div>
                                            </li>
                                            <asp:Repeater ID="rep_Attachment" runat="server">
                                                <ItemTemplate>
                                                        <li>
                                                            <div class="floatLeft">
                                                                <asp:CheckBox ID="cbChecked" runat="server" /></div>
                                                            <div class="floatLeft priviewFileName">
                                                                <asp:HiddenField ID="hfAID" runat="server" Value='<%#Eval("AID") %>' />
                                                                <%#Eval("Title") %></div> 
                                                            <div class="floatRight priviewFileText">[<a href='<%#Eval("FilePath") %>' target="_blank">预览</a>]</div>
                                                            <div class="clear"></div>
                                                        </li>
                                                </ItemTemplate>      
                                            </asp:Repeater>
                                        </ul>
                                    </td>
                                </tr>
                            </table>                           
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="content_title">
                            <asp:Button ID="btnSubmit" runat="server" Text="提交" onclick="btnSubmit_Click" />
                            <asp:Label ID="lblMsg" runat="server" Text="" CssClass="red"></asp:Label>
                        </td>
                    </tr>
                </table>
                
            </div>             
        </div>    
    </div>
    </form>
</body>
</html>
